<extend name="./Application/Admin/View/base.html" />
<block name="title"><title><?php echo C(APP_NAME);?>PC端管理</title></block>
<block name="stylesheets">
<link href="__PUBLIC__/assets/css/select2.css" rel="stylesheet">
</block>
<block name="stylecss">
<style type='text/css'>
    .pages a,.pages span {
        display:inline-block;
        padding:5px 9px;
        margin:0 1px;
        border:1px solid #f0f0f0;
    }
    .pages a,.pages li {
        display:inline-block;
        list-style: none;
        text-decoration:none; color:#58A0D3;
    }
    .pages a.first,.pages a.prev,.pages a.next,.pages a.end{
        margin:0;
    }
    .pages a:hover{
        border-color:#50A8E6;
    }
    .pages span.current{
        background:#50A8E6;
        color:#FFF;
        font-weight:700;
        border-color:#50A8E6;
    }
    .table input,select{
        border-radius:6px !important;
    }
</style>
</block>
<block name="smallmenu">
<ul class="breadcrumb">
	<li>
		<i class="ace-icon fa fa-home home-icon"></i>
		<a href="{:U('Index/index')}">主页</a>
	</li>
	<li class="active">发送系统消息</li>
</ul><!-- /.breadcrumb -->
<div class="nav-search" id="nav-search"><button class="btn btn-xs btn-pink" onClick='location.href="__CONTROLLER__/message_add"'>添加系统消息</button></div>
<!-- #section:basics/content.searchbox -->
<div class="nav-search" id="nav-search"></div><!-- /.nav-search -->
</block>
<block name="content">
    <input type="hidden" id="crontab-s" />
    <table id="sample-table-1" class="table table-striped table-bordered table-hover">
        <thead>
            <tr>
                <th class="center">编号</th>
                <th class="center">客户端</th>
                <th class="center">标题</th>
                <th class="center"><i class="ace-icon fa fa-clock-o bigger-110 hidden-480"></i>发布时间</th>
                <th class="center">操作</th>
            </tr>
        </thead>

        <tbody>
            <foreach name="message_arr" item="v">
            <tr style="text-align:center">
                <td class="center">{$key+1}</td>
                <td class="center">
                <?php if ($v['message_client'] == 1): ?>
                <span style="color:green">考生端</span>
                <?php elseif($v['message_client'] == 2): ?>
                <span style="color:blue">考官端</span>
                <?php endif ?>
                </td>
                <td>{$v.message_title}</td>
                <td>{$v.message_time|date='Y-m-d H:i:s',###}</td>
                <td>
                    <div class="hidden-sm hidden-xs btn-group">
                        <div class="hidden-sm hidden-xs action-buttons">

                            <a class="blue" style='cursor:pointer' title='查看消息详情'onClick='location.href="__CONTROLLER__/message_details/message_id/{$v.message_id}"'>
                                <i class="ace-icon fa fa-search-plus bigger-130"></i>
                            </a>

                            <a class="green" style='cursor:pointer' onClick='location.href="__CONTROLLER__/message_edit/message_id/{$v.message_id}"' title='修改消息信息'>
                                <i class="ace-icon fa fa-pencil bigger-130"></i>
                            </a>

                            <a class="red" style='cursor:pointer' onClick='dialog_see({$v.message_id})' title='删除消息'>
                                <i class="ace-icon fa fa-trash-o bigger-130"></i>
                            </a>
                        </div>
                    </div>
                </td>
            </tr>
            </foreach>
        </tbody>
    </table>
<div class="pages" style="float:right">{$page}</div>
<!-- 删除大师模态框（Modal） -->
<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" data-backdrop="static">
   <div class="modal-dialog modal-sm">
      <div class="modal-content">
         <div class="modal-header">
            <button type="button" class="close" aria-hidden="true" onClick='modal_close()'>×</button>
            <h4 class="modal-title" id="myModalLabel">删除消息</h4>
         </div>
         <div class="modal-body" style='padding-bottom:0px'>
            <div class="row" style='margin-bottom:15px;margin-left:2px;font-size:14px'>
                确认是否删除该消息？
            </div>
         </div>
         <div class="modal-footer">
            <button data-bb-handler="button" type="button" class="btn btn-sm" onClick='modal_close()'>取消</button>
            <button type="button" class="btn btn-sm btn-primary" onClick='type_submit()'>确定</button>
         </div>
      </div><!-- /.modal-content -->
   </div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</block>
<block name="scripts">
<script src="__PUBLIC__/assets/js/select2.js"></script>
</block>
<block name="jscript">
<script type="text/javascript">
    $(function(){
        $('#menu_message').addClass('active open');
        $('#menu_message_msg').addClass('active');
    });
</script>
<script script="text/javascript">
    //模态框查看信息
    function dialog_see(obj) {
        $('#crontab-s').val(obj);
        $('#myModal').modal('show');
    }

    //模态框关闭
    function modal_close() {
        $('#myModal').modal('hide');
    }

    //删除分类
    function type_delete(obj) {
        $('#myModal').modal('show');
    }

    //删除提交
    function type_submit() {
        var crontab = $('#crontab-s').val();
        $('#myModal').modal('hide');
        location.href="__CONTROLLER__/message_del/message_id/"+crontab;
    }
</script>
</block>